load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "serverccl",
    srcs = [
        "doc.go",
        "tenant_test_utils.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/ccl/serverccl",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/roachpb",
        "//pkg/rpc",
        "//pkg/security/securitytest",
        "//pkg/server/serverpb",
        "//pkg/sql",
        "//pkg/sql/contention",
        "//pkg/sql/sqlstats/persistedsqlstats",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/sqlutils",
        "//pkg/util/httputil",
        "//pkg/util/protoutil",
        "@com_github_stretchr_testify//require",
    ],
)

go_test(
    name = "serverccl_test",
    size = "enormous",
    srcs = [
        "admin_test.go",
        "api_v2_tenant_test.go",
        "main_test.go",
        "role_authentication_test.go",
        "server_controller_test.go",
        "server_sql_test.go",
        "server_startup_guardrails_test.go",
        "settings_test.go",
        "shared_process_tenant_test.go",
        "tenant_decommissioned_host_test.go",
        "tenant_migration_test.go",
        "tenant_vars_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":serverccl"],
    exec_properties = {"test.Pool": "large"},
    deps = [
        "//pkg/base",
        "//pkg/ccl",
        "//pkg/ccl/kvccl",
        "//pkg/ccl/utilccl/licenseccl",
        "//pkg/clusterversion",
        "//pkg/jobs",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/liveness",
        "//pkg/kv/kvserver/liveness/livenesspb",
        "//pkg/multitenant/tenantcapabilities",
        "//pkg/roachpb",
        "//pkg/security",
        "//pkg/security/password",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/server/authserver",
        "//pkg/server/serverpb",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/sql",
        "//pkg/sql/isql",
        "//pkg/sql/lexbase",
        "//pkg/sql/sem/catconstants",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sqlinstance/instancestorage",
        "//pkg/testutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util",
        "//pkg/util/envutil",
        "//pkg/util/httputil",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/protoutil",
        "//pkg/util/randutil",
        "//pkg/util/stop",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_elastic_gosigar//:gosigar",
        "@com_github_lib_pq//:pq",
        "@com_github_prometheus_client_model//go",
        "@com_github_prometheus_common//expfmt",
        "@com_github_stretchr_testify//require",
        "@org_golang_x_crypto//bcrypt",
    ],
)
